using System;
using System.IO;

namespace OpenEdge.Utility
{
	/// <summary>
	/// Summary description for Writer.
	/// </summary>
	public class Writer : IDisposable
	{

		protected FileStream fs;
		protected StreamWriter sw;

		public Writer() 
		{

		}

		public Writer(string logPath)
		{


		}

		public void WriteHandler(string messageString)
		{
            if (this.sw != null)
			    this.sw.Write(messageString);
		}

		public void WriteLineHandler(string messageString)
		{
            if (this.sw != null)
			    this.sw.WriteLine(messageString);
		}

		#region IDisposable Members

		public void Dispose()
		{
			this.sw.Close();
			this.sw = null;
			this.fs.Close();
			this.fs = null;			
		}

		#endregion

	}
}
